Added implementation for subtract function