I guess you can remove these 3 lines and change "is_positive" below to "is_nonnegative".