added additional comments for the writeOn and writeOff functions