inelegant but it does the job

Signed-off-by: Michael Donaghy <md401@srcf.ucam.org>