I added additional comments to main describing my data structures and approach to solving the problem.