Checkpoint
Rewrote arrows and semantic function to match paper