replaced removed d3.last w/ array.reduce and removed helper method compareLen