Implemented hack for not getting too close to the wall