LR35902: the branching is obtuse bollocks; but I think NOW it works