Made code work