implement low memory version (ranker2.lua)