Make sure that .paragraph is a number.
Minor corrections.

Fixed a spelling mistake and removed an unused variable.