update for more flexible