testing sparseae class
edit cost function