cleanup
changes to make it work on 64 bit OS.