added code and relevant plots