Added basic filtering. Fixes #1