Formatting changes;  fixed caching lengths