added controller to run the whole process