Matrix hw0 tasks 1-3