Complete overhaul and source

Ported to NetBeans