calculate bmi using a guard