Made changes to sliding with respect to corners and map lines.
checkPoint made into a function.