lowered end termination time. cleaned up output