Added filtering, and better saving.