Further refinements and experimentation with pandas.
Fixed an indent issue that was crushing performance.