Fix Atlas algorithm