optimizer code written