better crop function for crop