adds scripts to simplify
makes mode a global object