I wrote something similar (though admittedly more in depth) some time ago: https://www.cggonzalez.com/blog/index.html