fixed a breaking bug with commas going missing
corrected a code style mistake
documented the purpose of trimmedLines and originalLines
documented why comma is inserted inside the loop, rather than outside
documented the insertion of the weird placeholder space