half working collision detection etc

Lots of changes