added code for subtruct method