fix floating calc logic