Minor improvements of performance of step1. Changes were made based on the next points: first: at the begin of stage1 mask_matrix always is empty; second: after putting STAR into current row the algorithm interrupts loop (so it is not necessary to check STARs into current row); third: matrix is iterated by the algorithm from up to down (so it is not necessary to check STARs in bottom rows).