Refactored jsondouble and added comments