working 32 bits implem