Changed switch method slightly.

switched to using string find instead of re. Replaced prints with log messages.