added numkeys functionality