fixing bug
adding KM def