first optimization of cart
2nd optimization of cart