Added upper bound on k in NW