first impl
computation ist buggy
no attention paid to performance