Improving comments, double-checking logic throughout