Clean up. Add explanatory comments.