Added checkPos method to check the position of pointer before performing each function.
Merge branch 'master' of https://github.com/cs2103aug2014-t09-3j/main