Update Main.java

now writes collisions to the file