Updated to try to make scanning smarter