cleanup, mac more osx compatible, multiple changes