previous becomes prefix one letter at the time