Make function more julian / simpler

Yes, I realized this also when I looked at the source code. Thanks again for the help to everybody! This helped me a lot to think differently about the problem (independent of julia lang).