new implementations of findPosV and findPosH
still contains a few bugs