Made efficiency upgrades to modelonegrain