Removed global variables and retrieved necessary variables from "sandbox" field.
Updated structure information - Removed scale_mode.
Scaling bug fix - accidentally had the sign wrong. Whoops.
Various updates, comments, and bug fixes.