I've spent a while trying to figure this out. It doesn't work if all the numbers entered are negative. The reason is because b is initialized to zero, so if all the numbers are negative, b is never less than a. I've tried different things but none of them have worked. I tried setting b equal to null, but it turns out that this can't be done.