added leaving var methods and tests