trying to add bsd support
merges bsd and master