Implement first/last reductions