Working controller code, with some debug stuff in it