a rather plain julia solution...