corrected for 32bit systems. exported new read fns