variable typos corrected