first commit - still trying to loop with k groups