added support for arbitrarily many kbd