Implement reservoir sampling