added function objectToValue
added function objectFromValue