solved possible inconsistent float and double comparisons