fixed bug in decoder code; added Python bindings