Remove p parameter from constructor.
Add compact and expand functions.
Some docstring cleanup.