Changed some code to use regex. Removed all log statements.