Correct tile selection. Need to make optimizations, though.