Working version. Validator and JSON func specs to be done