updated to use logger instead of print out
fixed debugging and added logfile location