controller.c: latest controller that works