solved first and second task