cleaned up
fixed logging