Modified after discussions with Ricardo