trim implemented