is there an easy way of doing this witout using loops in loops in loops? I already made something that does the trick but there should be a simpler way....

Thnx!