Added generator code from old project