added if clause for float comparison