Added a generateNote function