pre optimization