added comments to mainframe.java