updated problem 9

Program finds correct triplets, variables need putting in correct order