updated Subtract function