Explained things in comments.