fixed bug returning length of 3rd seq rather than 1st
adjusted readability of some long lines