version 1.2 code rearranged

version 1.2 code rearranged