fixed typos and other errors. seems to work ok on windows