added a few functions for scripting
more infrastructure for scripting