added tile sorting