Ruby Script that brings series into an acceptable format