Updating code to produce plots