Work on the get previous value function