added a bunch of optimizations, added dockhandle hitcheck