Bug fix, simplification, commenting.