trying to loop without too many checks