First pass at a decoder