Front end code for TotemMash