added a whole bunch of funny stuff to eventually support collisions