Added snap checker to position function