Original work: Greg Page Further development since version 1.2: Dmitry Podgorny