Added function to autocomplete chains