updated with lodash and jquery