Matrix exercise | refactor @matrix var to @rows