Adding initial version of valueOf implementation