Filter function

Introduces filter function and fixed header