finished optimizer, works!