add for and if else