Generator.java (TO BE COMPLETED)