changed variable naming to be consitent with the project
findneighbors function to find the valid neighbors of a square