bug fix at statement end
bug fix and work for loop
remove old code