- implemented generate-method