better permissions and documentation
cleanup permissions function