Some debugging code added for asmt error in type checking.  Also created helper method for var lookup.