added MacOS support. Completely untested, since I dont have a mac