Istvan scala code