Initial collision detection implementation (bugs need to be fixed)