Change if/else with abs