refactored to use IO evilness rather than Data.Vector.Slow