initial import, mostly handcoded the libs