changed stuct variable names
added new function to find role users
fixed checking of fwrite