Filtering Updated

Very rough outline of filtering, ready to test with real data.