combined reduce and filter into 1 line