My attempt at implementing http://www.echorussia.ru/jobs/serverside-june-2013.html