second exercise of the course project