[update] cleaned up and documented answer