Integrated Duncan's code, but not sure how proceed in python works. Code does build and work though.