added code to make paper self-contained (only requires SMALLBox installation)