Write tests for tag decoding and add doc-string to functions
Fix docstrings