refactored filtering so works

filtering works through a hash, filters properly