remove unecessary neighbor function and add function to calculate adjacent spaces