more complicated accessor. fixing small compile bugs.