Solved isDecreasing problem