Changed notelength function