added shared memory optimization to collision, misc improvements