Simplified code, removed the need of ON.py and OFF.py