Updated solution for exercise ex-04-38.