updated for clarity

updated filtering code for clarity (based on recommendations)