fixed some problems with syntax in the outputted file