second commite from @fnozarian in main.java