added checkt to see if code is inside a function (or a method), needed for param and variable scope in declarations. Updated the tests to use the new declaraions