Matrix Inverse Index lab - tasks 2-4