Added logging capability. Gotta point out I don't know how to to use strcmp.