updates to checking for main in visit(Method)