code from app academy class