Tidy up the code, resolve low hanging fruits
Reduced the code duplication for zrevrange and zrange
Added additional comments for outputResult, and remove unnecessary TODO check