Implemented BSON decoding