Switched to a set and sort it before printing at the end so the values
are unique
Implemented check4to9 so it can be used to determine if we store the
next value