Reformatting of MainFrame and removed unused variables.