Added flag code for DC motor version