Assignment 4 of my Java class