lengthwise_statistics working beautifully and comments added, cleaned. stuff factored