Modified random generator; added horizontal collision detection