add context to function calls
add print and echo statements
remove unneeded elseif terminal
fix text processing in context