changed variable names to avoid enviro conflicts, executes twice as fast, error reporting works better, logic changes