write bmi to file