First version of controller and viewer work