Implemented code for pre_solve()
Removed write code