Added java implimentation