Updated version with comments.