implemented collisions, needs some fine tuning