Fixed all errors. Plot generated