adding wall spacing function