Tasks 1-4 solved