implemented filtering (closed #11, #13)