switched from uint to u32 where reasonable