code comments and optimization