Updated to support sandbox

Main code rev. 1808