int fact(int n) {
  int accum = 1;
  if (n == 1) return 1;
  for (int count = 1; count <= n; count++)
     accum *= count;
  return accum;
}
