Fixed a typo + cleaned the code semantics
Redone the background handling = considerable speedup