added a loop to print results. This section needs final edits and print statements.