optimise rank calculation
tidy
fix text
add zero rank tests
Extra rank tests