copy Main.java for code sample