now adds all loops. before was adding all by last loop