Overloading the generate method