moved to proper package, added tests