forgot to include sign when checking le/ge, reversed ternary