add functions for nesting objects by key and for looping through those objects to complete some action