Update final_main.java

the improved main