trim and edit