Added pertinent #includes and namespaces, as well as
possibly helpful functions from P1.