available_moves method now takes in the grid as an argument