Fix floating point comparison

Assuming 0.00000001 precision since that's EE default
Use 'var' everywhere in solution