implemented trim and paremeter