Solved Problem #9 and added a Triplet class.