Better error message
Optimize span norm
Initial code for finite horizon setup