added osx and some changes