Updated problem 6 with documentation, remove unnecessary print statements.