refactored, fixed crop bugs