Changed file to be based of FreeBSD, and reverted copied function to prevent errors