ported most of the host code - still have to port some derived constant
calculation and novel buffers