reduce scope of variable in quickSort loop