fixed bug when on 64 bit machine
removed unnecessary variables