added echoex function to demo script so it can be invoked rather than sourced