corrected some typos and added code to load required packages