new version works with assignment statements and print statements
removed bug