Task #2 solving (updeted)

Please add my updated solution for task #2