finish implementing calculate top sequences