working collision detection

lots of changes