update implementation to use rank instead of change