Risk implimented in Java