removed dependence on lodash, added tests