added collision detection code

add me plox