Altered generate()

Method generate has been altered.
TODO: Get the metadata to generate automatically