filtering mechanism implemented, formatting, bug fixing