added for loops for both single line and multi line also fixed right curly brace bug