functionality fix

made it usage, added freebsd compatibility.