Improving performance of LLMs on Science and Math Problems