Added decode_string function