added filter and minor tweaks