edited to java 8