typos fixed, code added