implemented another version of collision