Add source code comments and improve the quality.