added collision functionality