added function
loop and function