doing the decoding in the ruby script