Fixed filter bug. Added some documentation.

Needs more documentation and Timo's weighting.