fixing bugs with filtering and incorporating suggestions