this is a bit fiddly. Need to improve the Sec_0x approach.