tried to make loop