add Controller class for buttons, checkboxes etc.
Reformat some code with K&R style.