Cleaned up tile selection and highlighting code.