Stocks end in the green