Use a fixed-size array instead of a treeset