made some changes so that it should run on windows and linux.