Initial work on ranks, all functions are there, now to use them.