remove codes from Machine and create a NoteCollection