Rewritten blank and solve function. Solve not working properly