added a function to decode a cord