Fixed trying again. Adding premature stopping.
Implemented early stopping for turning on FL.
Final version. Speed is higher than demo.