Added filter functions. Work in theory, not tested yet.