fixed the bugs in merge and move function now one can set any value of the size of grid and set any target to achieve