added generator method in Generator