Function to normalize the data before normal eqn is run