the function for getting walls x-positions did not work properly. Rewrote them.