Original author: Ulf Wiger, Erlang Solutions, 2009 Copyright transfered to Ulf Wiger 2014