solution for course assignment