fixed bug in adjustUpperWall