improved logic in map file