Try this
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1453.msg5495#msg5495