added wall collision for x and y axes.