tied some more stuff together. got some filtering working. You'll have to take a good look at the query though and get the rest of it working