Implemented seq-max and longest-sequence