naive implementation of the decoder. checks if something is ready/ accepted / went wrong.  refs #1
some minor format changes refs #1