adding the ichain using functions