Help with code (Stepper Control)

Anyone have any ideas, feel free to re write my code,
what i'm after is a sketch that can allow me to run a stepper motor in both directions at varying speed based on the reading of the pot, and then I want to be able to stop the stepper by the use of a switch that turns on High and off Low.

Thanks