transpose, remove rows if possible