cleaned up comments and tested role function