add a new loadMatrix function