SAD modified for more robustness