Added filtering and better documentation for filter method