Modified doDfsForRootbeer check for overwriting methods of MainClass