trying to get loops working