Java code from my Data Structures class