Merge pull request #142 from irvs/issue65

modify end determination of move function
modify macro