Create functions Filter and Insert