Code cleaning and a better chart