added function support, added stepdisplay (needs improvement)