add commas to output file

also fixes small bugs. only output files for selected joints