added boolRef class - used to pass booleans by reference