restructuring datastore and adding tests
correcting comments