added some functions to make dealing with nested eithers easier