Added crop function