functions swapped around, found issue in product()