fixed and added some csv code