This is Lab 9 without the remove() and writeLessThan() functions