debugged errors, fixed typos