Created crop function