Asteroid code in Java