added solutions to tasks 1-4