Fixed and able to compile on mac