added code to save plot as pdf