changed AmariIndex calc to use more variables for clarity