improved getPosition, added more tests