in above code m116 does this work...
and value 9984 in the for loop is calculated and link y is moved with that much steps for reaching to cartesian home position, in my case the x link end stop is arranged such that it is corresponds to cartesian origin. so there is no need to move the x link after touching of link to end stop