But it sounds like you could just bash the logicalIds together and append the hash of the bash of the mash. Might not need loops or recursion.