You default to mode 0, but only document mode 1 and 2. Is there a third mode at all? If not, I'd make the 0 and 1