IMA2 sample code implementation