further adapting for handling multiple based on key in digest