Updated tile system

fixed variable issue maybe