fixed dictionary writing format

changed from using csvwriter to using a for loop