Sun appeared to enjoy himself there and even consumed animal faeces, calling them delicious. Pang believed that Sun was truly mad and lowered his guard. Sun later escaped from the Wei state with the help of diplomats from the Qi state. Service in Qi In the Qi state, Sun Bin became a retainer (guest) in the residence of Tian Ji, a military general. Once, King Wei of Qi invited Tian Ji to a horse racing competition. Sun Bin suggested a strategy to Tian Ji to utilize his horses to best advantage, and Tian won two out of three rounds in the race. The king was impressed with Tian's victory. Tian admitted that he won with the help of Sun Bin, and recommended Sun's talents to the king. King Wei wanted to appoint Sun Bin as the commander of the Qi armies. Sun declined, as his handicap prevented him from riding horseback, and would have a negative effect on the morale of soldiers. Sun was then appointed chief military advisor instead and served as Tian Ji's deputy. In 354 BC, Wei state attacked the Zhao state, with Pang Juan leading the Wei army. They besieged the Zhao capital city of Handan. Zhao requested help from Qi, and the king of Qi commissioned Sun Bin and Tian Ji to lead an army to help Zhao. Sun Bin proposed the strategy of "besieging Wei to rescue Zhao" and the Qi army attacked the Wei capital city of Daliang (present-day Kaifeng), forcing the Wei army to turn back to save the city and effectively lifting the siege on Handan. The Wei army was ambushed and defeated by the Qi forces at the Battle of Guiling. In 342 BC, the Wei army led by Pang Juan invaded the Han state, an ally of the Qi state, and Han requested help from Qi. Sun Bin and Tian Ji were put in charge of the Qi army again to counter the Wei forces. Sun used a strategy of feigning defeat in a series of skirmishes with the Wei forces, in order to lure Pang Juan to pursue him. Sun ordered the Qi troops to reduce the number of cooking stoves they used, creating the false impression that the Qi army was shrinking in size. The pursuing Wei forces led by Pang Juan spotted the trend by observing the marks left behind by the stoves, and Pang fell