finalized code/plots