Turn 'K' into runtime parameter.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>