Added more or less correct filtering