Initial version of rank, doesn't work.