Update

Updated logic and included some lodash