maps can have multiple tile sets
refactor to get rid of last* variables