added true k-d to the guts