add implementation for the rank method and tests