fixing compilation errors
newlines
added logging