clone from http://properjavardp.sourceforge.net/