added/modified java solutions