Demo written for http://stackoverflow.com/q/24883127/398670