updated collision detection algorhitm, added faster ones