Replace flags calculator for a newer version