Comments, removed unused stIdxWriter, and renamed var