removed value_from_object method as it was returning the wrong value.