implementing Gerty.java