Added validate code for analyzing error

Needs gadfly to plot graphics