added java assignment 2