changed perms a little bit and added a few tests