created thrust version for reduction. Works