Changed my approach to the problem.