Added note generation code and optimized intro a little.