writing subtract function