Code cleanup with more comments.