added amil logic