rewritten the simpleKnnLoss