implements grid snapping
Merge pull request #211 from bhattigurjot/master

implements grid snapping