pek1d,filehandling making savepath

change so it checks whether path exists