minor updates
optimized function to check if a coordinate is within the boundaries of the board