add code from pedro