added wrapper for determining appropriate number of k's