fixed more bugs, tidyed up collision.js
fixed merge error