implements scripting through functions