rewrote loops as reduce, remove the need for _.filter
rewrote function body to resemble named args method