Based on the work of Mladen Pejic http://www3.sympatico.ca/mladenpejic/index.htm