edit for optimization