comments added to main and writer