another swift experiment (that would have been done much easier in bash :P)