fixes issue #63.

updated code to populate chains so the modes are identified