Put output to file, fix float comparison