New code from Jimmy and Vinicius