Now that I've changed everything  I realize I probably should have used a treeset