More sandbox code and tests