Redis rewritten and tested