Created class to represent board space; fixed graph building function to use it.