Solution for course project.