Added exception throwing to methods; added in pseudocode for decode operation