Updates to SAD and MAD functions
Updates to SAD and MAD functions