added findMin sol