removed odd implementation that only worked for input training matrix of size nx2