made new turning algrithm