the order is the problem. When I switched your function to a-b it worked. (if a is < b then it should come first)