fix mixed tab/ws indenting
fix filename in csvwrite call, cd to $HOME