refactored the logic which looks up whether the grid has any free corner slots