Changed input method from System.console().readLine to BufferedReader since it will work in both IDEs (i.e. without consoles) and consoles.