factored out some sandbox content into defintions.R, added syntactic sugar