controller and view pseudocode