code from academyX class