small improvements

but the big win will be by changing algorithm to finding the longest
possible rather than building up from smallest