fix bug: variable should be float rather than int