fixed motor detection and sample programs