Make the algorithm faster, and made it work with Qu. Awaiting grade.