Interim Commit: works ok but not thoroughly tested - added types to range, added more boilerplate JSON, fixed bugs