Hello, I have made a simple circuit using the LM311N comparator to switch a single cell lithium battery from being charged by a solar cell charge controller to powering the load. I have set the hysteresis thresholds for the comparator between 3.4V and 4V and the switch used is a P channel MOSFET. Would this circuit work?