removed the ugly filtering method