First lesson: Don't write code when sleepy ....