added handy function for decoding