orking with Ranks. Not Tested for boundaries