initial threaded code implementation. works for small programs. has bug (null pointer / red stack overflow) for larger ones.