fixed 32/64-bit compatibility issues
instrumented for push-button profiling
achieved 4x speedup