initial version (code was developed in 2008)