Refined the decode algorithm\nAdded more difficult test case