added missing #include statements; a few formatting fixes.