realized but nasty
working version