assignment 6 : implement mkMatrix