added trim rows, trim columns; updated tests