Code from AP Computer Science