Decoding error-correcting codes with Grobner bases