Adds clear button; cleans up switch statements.