Adapt old Java homework for the task