Major rewrite of the code. Buttons are now generated dynamically. Ugly labels removed.