Simplified doflash function: Added function createCommand().