working csv output, checks for existence of parameters