trim rows and columns