processCorners function implemntation started