added implementation of Either