Modified R scripts to work under windows