typos corrected
problem causing infinite loop removed

Andrew Binning