Added rank generation with lambda