Scan and filter implemented with bugs. Not working.