Added radio button functionality.

This is still ugly and code needs formatting. Do not bother reviewing
this code section yet.