added these and removed the `require(pkg)` calls inside the function (to make it easier to keep track of dependencies)