updated, added tests