updated to match new variable/function interface