implementation of getValue. WIP