inner classes are now outer, implementation of hashCode and equals added