added code to generate command