admin function almost done