Wrote findMin but did not test.
Finished and tested findMin.