contestada

Which correctly uses or omits commas? Tony thought the problem seemed simple. After working on it for an hour, however, he changed his mind. Tony thought the problem seemed simple. After working on it for an hour however, he changed his mind.