ai, lab1, tasks 1 and 2