added proper generator code