added basic code for Mac