added subtract function and tested