added crop functionality