better solution for the tier problem