Changed class structure slightly.