Added code to read training data