Fix broken alt. code in filterloop() so that it works