added perms and tests