fixed up down counter and modified motor (not used yet)