Added comments and changed to using the syslog module instead of print