thats a very elegant solution! thank you very much, i appreciate the effort
so far i have to say i‘m pretty impressed by motoko. i‘m not very familiar with statically typed or functional languages, but it becomes familiar quite fast. especially looking at code examples from more experienced programmers is a great help, i‘m really looking forward to the time when i can just google stuff like that or consult stackoverflow.
in case anyone is interested in what im trying to do (some of you might have already guessed it):