update based on notes by @dnschneid