Phase transformation and impurity redistribution during pulsed laser irradiation of amorphous silicon layers