trim2 function

Remove empty outer rows and columns