Implementing https://plus.google.com/+MagnusHoff/posts/9gxSUZMJUF2