OK, well I'm not an expert on stepper motors. But how about finding a stepper library rather than doing it yourself?