edited programming assignement for reverse matrix