Packaged code

Repackaged some of the code.