Initial version

From handwritten notes; not verified from hardware