changed to calculate spaces (words - 1) and use Math.floor instead of rounding up