Works but fairly horrific
To get elegant code need arrays or objects?
Document document E03 (with bug)