add javapath for xlwrite and change scale_data to a function