vanilla IntSet code from the week3 slides