Major mods for final version.