changed global solution algorithm