Bugged snapping function (probably because of how $.get works)