modified function for ia.