use lodash
added some tests