primary functionality for front-end and json-write back end implemented