faster but cannot pass test5, need debug