Improved bdecoding and added list decoding