fixed the tabular_value function and added some specs