code refactoring for r6_rank2a()
debugging; not working yet