Added comments for modified optimize/evaluation
Scalar instead of apply