cleaned up warnings and reformatted controller.