fixing error in upsweep, results still wrong