added output and context functions