updated the sparse decoding code a bit