added 2 separate for loops so that feature normalization can occur for input training set matrix X of any size m x n