Motor with hall effect sensor headaches...

As a further note to the above, I've also tried an if else statement but again I can't get the motor to stop when the magnet has been passed in front of the hall sensor.