average (float array[], int array_length)
{
  float total, int divider = 0;

  for (i = 0; i < array_length; i ++)
  {
    total += array[i]; divider ++;
  }

  return (divider != 0) ? (total / divider) : 0;
}
