I'd use "mode" here, instead of reading a var