corrected some typos and minor bugs