added SampleReader, training phase improved