Generator functioning