Biellie, why all the /halts? I mean, you're not using goto command here. They can be omitted with if conditions. This script can further be improved.