add accessors and references, and make the code thus compiling again