changed note variable, organized code