working iap code