format file extension correctly and taking a stab at creating csv correctly