first working optimizer version