changes to be mac/unix portable