spiral check base case + h > 0 && w > 0