Update getKey method of Main.java