Update Main.java

Restore from upstream