First Version of decoding.rb