adding support for while statements and tests using callbacks