Working version. Still has lots of holes in timing. Will move to more low level.