made uniform random sample in map phase slightly more efficient
generalized comparable pair data structure
completed reservoir sampling using heap method with random keys