created boolean argument and for loop