Rewrote dec-to-bin using Java API