Quick fix to isValid method to not reject solutions mistakenly due to floating point error