reorganised, and started iup wrapper