a little optimizaiton of rank
add get with rank