add Tilemap, fix various bugs