added require_once Filestore class and refactored read and write