Ruby script to normalize data