added ami functions