add return type, call it filterWithScalar.