fixed adrians code