Added ++ i in the loop