adding check for approximate solution flag