ctdot initial checkin

There's a lot of ugly but it works. Cleanup later