Fixed printing newline problem and added comment to main
Merge mufit's corrections into master