Addded java code blocks