Modified add commitment mechanism to use HashMap