implementation covers simple tests, added some extended tests