error correcting; other improvements