Patched to also use non-double-values