complete architecture

TODO: create tests and pass them