homework3: fixes to make it compile under vs2008