Changed lists to sets, added 404 logic, moved ignore logic to function