Added filtering to hash and array writer