Added input checks. If not a number, then restores previous correct variables.