Fixed a divide by 0 bug. Eliminated some useless empty line outputs.