update m,n & add reasoning for redoing