Aim is to avoid having to do this in multiple rounds with in-memory operations which are harder to follow