added longest increasing sequence
tidyup code