generator working