Modified code

Made several modifications to make the prompts, variables and alerts
work in the correct order.