refactored increasing? and decreasing? methods to remove array operations