final Code with admin changes