fix mainframe to fit Emil's changes