made a nice longest increasing subsequence implementation