us5250 - tidying up and adding asserts