finalized test and implementation of controller.