obtain_value function

Obtain value from a vector