More work on generate