added ko, some logic