cleanups
fixed crop std::swap related bug, was swapping the pointers not the values