Completed most of the function to admin