rough sketch of the backend