Added dynamic coloring to selected tile depending on validity of position.