changes to make it compile on mac