Wrote PseudoCode for Controller