add HH simulation code