Modified add commitment mechanism to use hashmap