tasks 4 to 7 from AcademyPopcorn