>I suspect this is pre-existing code

Yes this is based on the previous code, I'll look into it.