add 32 and 64 bit support and detection algorit