implement without converting to char list