Implemented all problems.