change some functions to accept Iterables and fix some tests #184