modified the java homeless codes post