Add user interface and reformat code