Implemented collission detection