Fixed bugs/typos - now compiles