MUCH cleaner value function.