take sex as input, write csv, code-cleanup