Version with Optimization

Includes initial optimization.