First attempt at part 6 of assignment 1