added filter and reduce to lambda