Updated crop function, added filter